<template>
	<div class="iInfo" element-loading-text="加载中" v-loading="loading">
		<div class="flex">
			<div class="lumpBox">
				<div class="Lbox-title"><h2>立项申请</h2></div>
				<div class="Lbox-content">
					<projectDetails :elForm="elForm" ref="projectDetails"></projectDetails>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
import projectDetails from './popup/project_details.vue'
export default {
	name: 'add',
	data() {
		return {
			loading: false,
			elForm: {
				type: 0,
				project_class: 1,
				project_type: 2,
				customer: '',
				project_name: '',
				date1: '',
				date2: '',
				date3: '',
				user: '',
				performance: '',
				remark: '',
				direction: '',
				file: []
			},
		};
	},
	components: {projectDetails},
	created() {
		this.$emit('pass', '/add');
	},
	mounted() {},
	methods: {
		papersUploadSuccess2 (res) {
			if (res.code == 0) {
				this.elForm.file.push(res.data.path)
			} else {
				this.$layer.msg(res.msg);
			}
			console.log(this.elForm.file)
		},
		uploadError (res) {
			this.$layer.msg(res.msg)
		},
		removeFile(file) {
			this.elForm.file.splice(this.elForm.file.findIndex(e => e === file.response.data.path), 1)
		},
		validateDocument (file) {
			var arr = ['pdf', 'docx', "rar", "doc", "xls", "xlsx",'zip',"jpg","png","jpeg","7z"]
			var current = file.name.split('.');
			var suffix = current[current.length - 1];
			if (arr.indexOf(suffix) === -1) {
				this.$layer.msg('文件类型只能是' + arr.join(','))
				return false
			}
			return true
		},
		addProject() {

		}
	}
};
</script>
<style lang="scss" scoped>
	
</style>